//
//  ShopListTableView.m
//  stone-story
//
//  Created by liu dodo on 12-9-28.
//  Copyright (c) 2012年 liu dodo. All rights reserved.
//

#import "ShopListTableView.h"

@implementation ShopListTableView
@synthesize resultArray=_resultArray;
@synthesize delegate = _delegate;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        
        //CGRect tableFrame=CGRectMake(220,0,804,704); //矩形结构
        /*
        ShopListTableView=[[UITableView alloc] initWithFrame:frame]; //分配内存，设置样式
        [ShopListTableView setDelegate:self]; //设置代理
        [ShopListTableView setDataSource:self]; //设置数据源
        [ShopListTableView setBackgroundColor:[UIColor clearColor]];
        [ShopListTableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
        [ShopListTableView setAllowsSelection:NO];
        [self addSubview:ShopListTableView]; //添加到父视图
        */
    }
    return self;
}




#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    
    // Return the number of rows in the section.
    return [_resultArray count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    // Configure the cell...
    NSDictionary *cell_text = [_resultArray objectAtIndex:indexPath.row];
    cell.textLabel.text=[cell_text  objectForKey:@"categroy_name"];
    
    return cell;
}



#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
}


@end
